package com.yx.musicplayer.greendao.gen;

import java.util.Map;

import org.greenrobot.greendao.AbstractDao;
import org.greenrobot.greendao.AbstractDaoSession;
import org.greenrobot.greendao.database.Database;
import org.greenrobot.greendao.identityscope.IdentityScopeType;
import org.greenrobot.greendao.internal.DaoConfig;

import com.yx.musicplayer.greendao.Lrc;
import com.yx.musicplayer.greendao.Song;
import com.yx.musicplayer.greendao.RecentSong;

import com.yx.musicplayer.greendao.gen.LrcDao;
import com.yx.musicplayer.greendao.gen.SongDao;
import com.yx.musicplayer.greendao.gen.RecentSongDao;

// THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT.

/**
 * {@inheritDoc}
 * 
 * @see org.greenrobot.greendao.AbstractDaoSession
 */
public class DaoSession extends AbstractDaoSession {

    private final DaoConfig lrcDaoConfig;
    private final DaoConfig songDaoConfig;
    private final DaoConfig recentSongDaoConfig;

    private final LrcDao lrcDao;
    private final SongDao songDao;
    private final RecentSongDao recentSongDao;

    public DaoSession(Database db, IdentityScopeType type, Map<Class<? extends AbstractDao<?, ?>>, DaoConfig>
            daoConfigMap) {
        super(db);

        lrcDaoConfig = daoConfigMap.get(LrcDao.class).clone();
        lrcDaoConfig.initIdentityScope(type);

        songDaoConfig = daoConfigMap.get(SongDao.class).clone();
        songDaoConfig.initIdentityScope(type);

        recentSongDaoConfig = daoConfigMap.get(RecentSongDao.class).clone();
        recentSongDaoConfig.initIdentityScope(type);

        lrcDao = new LrcDao(lrcDaoConfig, this);
        songDao = new SongDao(songDaoConfig, this);
        recentSongDao = new RecentSongDao(recentSongDaoConfig, this);

        registerDao(Lrc.class, lrcDao);
        registerDao(Song.class, songDao);
        registerDao(RecentSong.class, recentSongDao);
    }
    
    public void clear() {
        lrcDaoConfig.clearIdentityScope();
        songDaoConfig.clearIdentityScope();
        recentSongDaoConfig.clearIdentityScope();
    }

    public LrcDao getLrcDao() {
        return lrcDao;
    }

    public SongDao getSongDao() {
        return songDao;
    }

    public RecentSongDao getRecentSongDao() {
        return recentSongDao;
    }

}
